package comOne.service.impl;

import comOne.dao.LoginStudentdao;
import comOne.domain.Studnets;
import comOne.service.loginService;

import javax.servlet.annotation.WebServlet;
import java.util.List;


public class loginServiceImpl implements loginService {
    @Override
    public int loginServicestu(Studnets student) {
        /* resp.setContentType("text/html; charset=utf-8");*/
        int a=0;
        String username = student.getUsername();
        String password = student.getPassword();
        LoginStudentdao loginStudentServlet = new LoginStudentdao();
        List<Studnets> list = loginStudentServlet.list();
        for (Studnets studnets : list) {
            if (studnets.getUsername().equals(username) && studnets.getPassword().equals(password)) {
               a=1;
               break;
            }
            /* resp.setHeader("Refresh", "3;URL=/log.jsp");*/
        }
        return a;
    }
}

